#pragma once

#include <windows.h>
#include <iostream>
#include <fstream>
#include <string>
#include <istream>
#include <ostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <memory>
#include <filesystem>

#include <d3d11_1.h>

namespace Out
{
    inline void Print(const char* format, ...) {

        char buffer[256];
        va_list args;
        va_start(args, format);
        vsnprintf(buffer, sizeof(buffer), format, args);
        va_end(args);

        OutputDebugStringA(buffer);
        OutputDebugStringA("\n");
    }
}


#define COLOR_NONE         "\033[m"
#define COLOR_RED          "\033[0;32;31m"
#define COLOR_LIGHT_RED    "\033[1;31m"
#define COLOR_GREEN        "\033[0;32;32m"
#define COLOR_LIGHT_GREEN  "\033[1;32m"
#define COLOR_BLUE         "\033[0;32;34m"
#define COLOR_LIGHT_BLUE   "\033[1;34m"
#define COLOR_DARY_GRAY    "\033[1;30m"
#define COLOR_CYAN         "\033[0;36m"
#define COLOR_LIGHT_CYAN   "\033[1;36m"
#define COLOR_PURPLE       "\033[0;35m"
#define COLOR_LIGHT_PURPLE "\033[1;35m"
#define COLOR_BROWN        "\033[0;33m"
#define COLOR_YELLOW       "\033[1;33m"
#define COLOR_LIGHT_GRAY   "\033[0;37m"
#define COLOR_WHITE        "\033[1;37m"


#ifdef _CONSOLE

#define LOGI(fmt, ...) std::printf(COLOR_NONE "[%s] [%s] [%s] " fmt COLOR_NONE "\n", __DATE__, __TIME__, "info", ##__VA_ARGS__)
#define LOGE(fmt, ...) std::printf(COLOR_RED "[%s] [%s] [%s] "fmt COLOR_NONE "\n", __DATE__ , __TIME__, "error", ##__VA_ARGS__)
#define LOGD(fmt, ...) std::printf(COLOR_GREEN "[%s] [%s] [%s] "fmt COLOR_NONE "\n",__DATE__ , __TIME__, "debug", ##__VA_ARGS__)
#define LOGW(fmt, ...) std::printf(COLOR_YELLOW "[%s] [%s] [%s] "fmt COLOR_NONE "\n", __DATE__ , __TIME__, "warning", ##__VA_ARGS__)

#else
#define LOGI(fmt,...) Out::Print("[%s %s]" fmt, __DATE__, __TIME__ ,__VA_ARGS__) 

#endif